package puan.com.weighBox.util;

/**
 * Create by chhyu
 * on 2019/6/11
 * Describle:
 */
public class ExcelUtil {
//    /**
//     * 读取Excel数据
//     *
//     * @return List<SanXiangSiBean>
//     */
//    public static List<BoxRecordResbean> readSanXiangSiExcel(Context context) {
//        List<BoxRecordResbean> sanXiangSiBeanList = new ArrayList<>();
//        try {
//            InputStream is = context.getAssets().open("sanxiangsi.xls");
//            Workbook book = Workbook.getWorkbook(is);
//            book.getNumberOfSheets();
//            // 获得第一个工作表对象
//            Sheet sheet = book.getSheet(0);
//            int Rows = sheet.getRows();
//            for (int i = 1; i < Rows; ++i) {
//                //将每一列的数据读取
//                String index = (sheet.getCell(0, i)).getContents();
//                String one = ((sheet.getCell(1, i)).getContents());
//                String two = (sheet.getCell(2, i)).getContents();
//                String three = (sheet.getCell(3, i)).getContents();
//                String four = (sheet.getCell(4, i)).getContents();
//                String five = (sheet.getCell(5, i)).getContents();
//                String result = (sheet.getCell(6, i)).getContents();
//                String interpretationOfResult = (sheet.getCell(7, i)).getContents();
//
//                sanXiangSiBeanList.add(new SanXiangSiBean(null, index, one, two, three, four, five, result, interpretationOfResult));
//            }
//            book.close();
//        } catch (Exception e) {
//            e.printStackTrace();
//            Log.e("lmsg", "读取异常==" + e.getMessage());
//        }
//        return sanXiangSiBeanList;
//    }
//
//    /**
//     * 读取Excel数据
//     *
//     * @return List<SanXiangSiBean>
//     */
//    public static List<SanXiangSanBean> readSanXiangSanExcel(Context context) {
//        List<SanXiangSanBean> sanXiangSanBeanList = new ArrayList<>();
//        try {
//            InputStream is = context.getAssets().open("sanxiangsan.xls");
//            Workbook book = Workbook.getWorkbook(is);
//            book.getNumberOfSheets();
//            // 获得第一个工作表对象
//            Sheet sheet = book.getSheet(0);
//            int Rows = sheet.getRows();
//            for (int i = 1; i < Rows; ++i) {
//                //将每一列的数据读取
//                String index = (sheet.getCell(0, i)).getContents();
//                String one = ((sheet.getCell(1, i)).getContents());
//                String two = (sheet.getCell(2, i)).getContents();
//                String three = (sheet.getCell(3, i)).getContents();
//
//                String zuBie = (sheet.getCell(4, i)).getContents();
//                String result = (sheet.getCell(5, i)).getContents();
//                String jieGuoFenXi = (sheet.getCell(6, i)).getContents();
//                String biaoDaShi = (sheet.getCell(7, i)).getContents();
//
//                sanXiangSanBeanList.add(new SanXiangSanBean(null, index, one, two, three, zuBie, result, jieGuoFenXi, biaoDaShi));
//            }
//            book.close();
//        } catch (Exception e) {
//            e.printStackTrace();
//            Log.e("lmsg", "sanxiangsan读取异常==" + e.getMessage());
//        }
//        return sanXiangSanBeanList;
//    }
}
